package global.security;

import java.net.Authenticator;
import java.net.PasswordAuthentication;

public class BasicAuthenticator extends Authenticator {
    /** 代理用户名 */
    private String userName;
    /** 代理密码 */
    private String password;

    public BasicAuthenticator(String userName, String password) {  
        this.userName = userName;  
        this.password = password;  
    }

    @Override  
    protected PasswordAuthentication getPasswordAuthentication() {  
        return new PasswordAuthentication(userName, password.toCharArray());  
    }
}
